Chi Square Public school enrollment before and after 1989 hypothesis: I believe that the variable year has a positive association with the variable public. In other words, I believe that there is an association between time and public school enrollment and that the enrollment in public schools depends on the year.
table(school$yearcat, school$publiccat)
Low Medium High
Before 1989 11 13 0
After 1989 0 8 11
chisq.test(table1)
Pearson's Chi-squared test
Based on the small p value, one can reject the null hypothesis and conclude that there is a difference in enrollment in public schools before and after 1989.
Chi Square Private School enrollment before and after 1989
table(school$yearcat, school$privatecat)
Low Medium High
Before 1989 11 13 0
After 1989 0 1 18
Based on the small p value, one can reject the null hypothesis and conclude that there is also a difference in enrollment in public schools before and after 1989.
Regression Analysis Public School Enrollment from 1965 - 2008
model <- lm(school$Public ~ school$Year) > summary(model)
Call: lm(formula = school$Public ~ school$Year)
Residuals: Min 1Q Median 3Q Max -4.6140 -1.7303 0.1602 2.4642 3.6510
Coefficients: Estimate Std. Error t value Pr(>|t|)
(Intercept) -554.03040 62.39914 -8.879 0.00000000003449 * school$Year 0.30607 0.03141 9.744 0.00000000000242 * ---
Signif. codes: 0 ‘*’ 0.001 ‘’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.646 on 42 degrees of freedom (21 observations deleted due to missingness)
Multiple R-squared: 0.6933, Adjusted R-squared: 0.686
F-statistic: 94.95 on 1 and 42 DF, p-value: 0.00000000000242
Regression Analysis Private school enrollment from 1965 - 2008
lm(formula = school$Private ~ school$Year)
Residuals:
Min 1Q Median 3Q Max
-0.6665 -0.3429 -0.1373 0.2802 1.2265
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -140.43252 10.78700 -13.02 0.000000000000000246 *
school$Year 0.07504 0.00543 13.82 < 0.0000000000000002 * ---
Signif. codes: 0 ‘*’ 0.001 ‘’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.4574 on 42 degrees of freedom (21 observations deleted due to missingness)
Multiple R-squared: 0.8197, Adjusted R-squared: 0.8154
F-statistic: 191 on 1 and 42 DF, p-value: < 0.00000000000000022
Chi Square Public school enrollment before and after 1989
hypothesis: I believe that the variable year has a positive association with the variable public. In other words, I believe that there is an association between time and public school enrollment and that the enrollment in public schools depends on the year.
table(school$yearcat, school$publiccat)
Low Medium High
Before 1989 11 13 0
After 1989 0 8 11
chisq.test(table1)
Pearson's Chi-squared test
data: table1
X-squared = 22.919, df = 2, p-value = 0.00001055
Based on the small p value, one can reject the null hypothesis and conclude that there is a difference in enrollment in public schools before and after 1989.
Chi Square Private School enrollment before and after 1989
table(school$yearcat, school$privatecat)
Low Medium High
Before 1989 11 13 0
After 1989 0 1 18
table2<-table(school$yearcat, school$privatecat) > chisq.test(table2)
Pearson's Chi-squared test data: table2
X-squared = 39.2348, df = 2, p-value = 0.000000003022
Based on the small p value, one can reject the null hypothesis and conclude that there is also a difference in enrollment in public schools before and after 1989.
Regression Analysis
Public School Enrollment from 1965 - 2008
model <- lm(school$Public ~ school$Year) > summary(model)
Call: lm(formula = school$Public ~ school$Year)
Residuals: Min 1Q Median 3Q Max -4.6140 -1.7303 0.1602 2.4642 3.6510
Coefficients: Estimate Std. Error t value Pr(>|t|)
(Intercept) -554.03040 62.39914 -8.879 0.00000000003449 *
school$Year 0.30607 0.03141 9.744 0.00000000000242 * ---
Signif. codes: 0 ‘*’ 0.001 ‘’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.646 on 42 degrees of freedom (21 observations deleted due to missingness)
Multiple R-squared: 0.6933, Adjusted R-squared: 0.686
F-statistic: 94.95 on 1 and 42 DF, p-value: 0.00000000000242
Regression Analysis
Private school enrollment from 1965 - 2008
lm(formula = school$Private ~ school$Year)
Residuals:
Min 1Q Median 3Q Max
-0.6665 -0.3429 -0.1373 0.2802 1.2265
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -140.43252 10.78700 -13.02 0.000000000000000246 *
school$Year 0.07504 0.00543 13.82 < 0.0000000000000002 * ---
Signif. codes: 0 ‘*’ 0.001 ‘’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.4574 on 42 degrees of freedom (21 observations deleted due to missingness)
Multiple R-squared: 0.8197, Adjusted R-squared: 0.8154
F-statistic: 191 on 1 and 42 DF, p-value: < 0.00000000000000022